#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define XH(i,a,b) for(int i = a; i < b; ++i)
#define XXH(i,b,a) for(int i = b; i >= a; --i)
#define Module 998244353
int tmpInt;ll tmpll;string tmpStr;char tmpChar;
vector<int>tmpIntVector;

unordered_map<ll,int>ump;
int main(){
  ll n;cin>>n;
  if(n == 1){
    cout<<1<<endl;
    return 0;
  }
  ll ans = n;
  for(ll i = 2; i <= sqrt(n); ++i){
    double number = i*i;
    ll j = 2;
    if(ump[(ll)number] == 0)
      for(j = 2; (ll)number <= n; ++j){
        number *= i;
        ump[(ll)number] = 1;
      }
    ans -= (j-2);
  }
  cout<<ans<<endl;
  return 0;
}
